From: Jasper St. Pierre Date: Mon, 20 May 2013 17:54:48 +0000 (-0400) Subject: messageTray: Add a synonym for hasNotifications X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~4147 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=d96726c39249c8a2b779f09c5cfdf9baa435015d;p=gnome-shell.git messageTray: Add a synonym for hasNotifications This prevents lines from getting too long. https://bugzilla.gnome.org/show_bug.cgi?id=700639 --- diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 147f8cf77..28eef9294 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -2203,11 +2203,13 @@ const MessageTray = new Lang.Class({ let notificationQueue = this._notificationQueue.filter(function(n) { return !n.acknowledged; }); + let hasNotifications = Main.sessionMode.hasNotifications; + this._notificationQueue = notificationQueue; let notificationUrgent = notificationQueue.length > 0 && notificationQueue[0].urgency == Urgency.CRITICAL; let notificationForFeedback = notificationQueue.length > 0 && notificationQueue[0].forFeedback; let notificationsLimited = this._busy || Main.layoutManager.bottomMonitor.inFullscreen; - let notificationsPending = notificationQueue.length > 0 && (!notificationsLimited || notificationUrgent || notificationForFeedback) && Main.sessionMode.hasNotifications; + let notificationsPending = notificationQueue.length > 0 && (!notificationsLimited || notificationUrgent || notificationForFeedback) && hasNotifications; let nextNotification = notificationQueue.length > 0 ? notificationQueue[0] : null; let notificationPinned = this._pointerInNotification && !this._notificationRemoved; let notificationExpanded = this._notification && this._notification.expanded; @@ -2215,7 +2217,7 @@ const MessageTray = new Lang.Class({ !(this._notification && this._notification.urgency == Urgency.CRITICAL) && !(this._notification && this._notification.focused) && !this._pointerInNotification; - let notificationLockedOut = !Main.sessionMode.hasNotifications && this._notification; + let notificationLockedOut = !hasNotifications && this._notification; let notificationMustClose = this._notificationRemoved || notificationLockedOut || (notificationExpired && this._userActiveWhileNotificationShown) || this._notificationClosed; let canShowNotification = notificationsPending && this._trayState == State.HIDDEN; @@ -2231,7 +2233,7 @@ const MessageTray = new Lang.Class({ this._ensureNotificationFocused(); } - let mustHideTray = this._notificationState != State.HIDDEN || !Main.sessionMode.hasNotifications; + let mustHideTray = this._notificationState != State.HIDDEN || !hasNotifications; // Summary notification let haveClickedSummaryItem = this._clickedSummaryItem != null;